﻿Imports System.IO
Imports System.Xml.Serialization

Public Class XmlSerializer(Of T)
    Implements ISerializer(Of T)

    Private Serializer As New XmlSerializer(GetType(T))

    Public Function Desrialize(ByVal stream As Stream) As T Implements ISerializer(Of T).Desrialize
        Dim obj As T = Serializer.Deserialize(stream)
        Return obj
    End Function

    Public Sub Serialize(ByRef stream As Stream, ByVal obj As T) Implements ISerializer(Of T).Serialize
        Serializer.Serialize(stream, obj)
    End Sub
End Class
